package test.h0814;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.StringJoiner;

/**
  * @description 用连续自然数之和来表达整数
  * @author 不知名帅哥
  * @date 2024/8/14 21:32
  * @version 1.0
*/
public class Main6 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int num = sc.nextInt();
        getRes(num);
    }

    private static void getRes(int num) {
        List<List<Integer>> res=new ArrayList<>();
        //使用公式1/2 *n(n-1)
        for (int i = 1; i < num; i++) {
            int a1 = process(num, i);
            if (a1>0){
                List<Integer> list = new ArrayList<>();
                for (int j = 0; j < i; j++) {
                    list.add(a1);
                    a1++;
                }
                res.add(list);
            }
        }
        for (List<Integer> tmpList : res) {
            StringJoiner joiner = new StringJoiner("+");
            for (Integer a : tmpList) {
                joiner.add(a+"");
            }
            String builder = num + "=" +
                    joiner;
            System.out.println(builder);
        }
        System.out.println("Result:"+res.size());
    }

    private static int process(int num,int n) {
        int ans=0;
        int a1 = num / n - (n - 1)/2;
        if (n*a1+(n-1)*n/2==num){
            ans= a1;
        }
        return ans;
    }
}
